import BaseApi from '../BaseApi';

const controller = "/entryExitRecord";

const mergeController = "/mergeOrder";

export default {

    getEntryExitRecordList(condition) {
        return this.requestPost(controller, "/getEntryExitRecordList", condition);
    },
    getOrderDetail(condition) {
        return this.requestPost(controller, "/getOrderDetail", condition);
    },

    /** 订单合并
     * @description LiuTing
     * @date 2021/10/13
     */
    getMergeOrder(condition) {
        return this.requestPost(mergeController, "/getMergeOrder", condition);
    },
    mergeOrderRecord(recordIds) {
        return this.requestPostForJson(mergeController, "/mergeOrderRecord", recordIds);
    },
    getMergeOrderInfo(remark){
        let obj={"remark": remark};
        return this.requestPost(mergeController, "/getMergeOrderInfo", obj);
    },

    /** excel数据导出
     * @description
     * @date 2019/7/11
     */
    exportEntryExitRecordExcel(condition) {
        return this.requestDownloadGet(controller, "/entryExitRecordExcel", condition);
    },

    downLoadEntryExitImages(condition) {
        return this.requestPost(controller, "/downLoadEntryExitImages", condition);
    },

    dispatchParking({ targetId, parkName, parkingSpaceName, truckSpaceId }) {
        return this.requestPost(controller, "/dispatch", { targetId, parkName, parkingSpaceName, truckSpaceId });
    },

    /** 导出任务
     * @description LiuTing
     * @date 2021/09/18
     */
    getExportTaskList(data){
        return this.requestPost(controller, "/getExportTaskList", data);
    },
    deleteTaskClick(data){
        return this.requestPost(controller, "/deleteTaskClick", data);
    },
    saveOrderPayStatus(data){
        return this.requestPost(controller, "/saveOrderPayStatus", data);
    },

    /*请求封装*/
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);
    },
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestDownloadGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestDownloadGet(newUrl, condition);
    },
    requestPostForJson(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPostForJson(newUrl, condition);
    },
}